package com.framework;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@EnableSwagger2
@MapperScan(basePackages = { "com.framework.modules.*.dao" })
public class AdminApplication extends SpringBootServletInitializer {
	protected static Logger logger = LoggerFactory.getLogger(AdminApplication.class);

	public static void main(String[] args) {
		Boolean debugRun = false;
		logger.info("正在启动应用...............");

		if (debugRun) {
			try {
				SpringApplication.run(AdminApplication.class, args);
			} catch (Exception e) {
				e.printStackTrace();
			}
		} else {
			SpringApplication.run(AdminApplication.class, args);
		}
		logger.info("启动完成");
	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(AdminApplication.class);
	}
}
